package com.aiwei.tdjk.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
/**
 * Created with IntelliJ IDEA
 * Created By yyj
 * Date: 2017/3/15
 * Time: 9:10
 */
@NoArgsConstructor
@AllArgsConstructor
public enum SexEnum {
    male(1,"男"),female(0,"女");

    @Getter
    private Integer code;
    @Getter
    private String info;


    public static SexEnum getValue(Integer code) {
        final SexEnum[] values = SexEnum.values();
        for (SexEnum value : values) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return null;
    }
}
